import request from '../utils/request'

export const login = data => {
  return request({
    method: 'POST',
    url: '/v1_0/authorizations',
    data: data
  })
}
// 发送验证码
export const sendSms = mobile => {
  return request({
    method: 'GET',
    url: `/v1_0/sms/codes/${mobile}`
  })
}

// 获取用户信息
export const userInfo = () => {
  return request({
    method: 'get',
    url: '/userInfo'
  })
}

// 修改用户信息
export const getUserInfo = (data) => {
  return request({
    method: 'put',
    url: `/userInfo/${data.id}`,
    data
  })
}

// 修改用户头像
export const updateUserPhoto = (data) => {
  return request({
    method: 'PATCH',
    url: '/app/v1_0/user/profile',
    data
  })
}
